package com.hx.bj.datahandleboot.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.hx.bj.datahandleboot.dao.SQLMapper;
import com.hx.bj.datahandleboot.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @Author: chenYuTao
 * @ @CreateTime: 2021/9/1 22:21
 * @Description:
 **/

@Service
public class UserServiceImpl implements UserService {

    private final static Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    private SQLMapper sqlMapper;


    @Override
    public String add() {
        List<HashMap<String, Object>> hashMaps = sqlMapper.selectByParem1("select * from users");
        String resultStr = JSONObject.toJSONString(hashMaps);
        logger.info(resultStr);
        return resultStr;
    }
}
